#ifndef _WDS_FADEDECAY_H_
#define _WDS_FADEDECAY_H_

#include "ui/ui_sprite.h"




class WDSFadeBlood
{
public:

	enum FADEBLOOD_STATE	
	{
		FADEBLOOD_STATE_NONE,
		FADEBLOOD_STATE_ALPHAUP,
		FADEBLOOD_STATE_STILL,
		FADEBLOOD_STATE_ALPHADOWN,
		FADEBLOOD_STATE_FINISH,
		FADEBLOOD_STATE_C,

	};

	WDSFadeBlood();
	
	
	
	void								Render(ui::UISprite& Sprite, const math::Vec2& Offset,float Scale);
	void								RenderDebug(const math::Vec2& Offset,float Scale);
	void								Tick(float dt);	
	bool								IsReadyToSpawn() const { return m_State == FADEBLOOD_STATE_FINISH;  };
	void								ReSpawn(const math::Vec2& Pos, float Rotation);		
	

protected:

	bool								IsInsideScreen(const math::Vec2& Pos) const;
	

	float								m_DecaySpeed;
	FADEBLOOD_STATE						m_State;

	math::Vec2							m_Pos;		
	float								m_Rotation;
	float								m_Alpha;
	float								m_Duration;

	
};

class WDSFadeBloodManager
{
public:
	
	static WDSFadeBloodManager&			Instance();

	void								Render( const math::Vec2& Offset,float Scale);
	void								RenderDebug(const math::Vec2& Offset,float Scale);
	void								Tick(float dt);

	void								Spawn(	const math::Vec2& Pos, 
											float Rotation,
											float Duration);
	void								Clear();

protected:

	WDSFadeBloodManager();
	~WDSFadeBloodManager();

	std::vector<WDSFadeBlood*>			m_FadeBloods;
	ui::UISprite						m_Sprite;	
};

#endif